
function userinfo(state = { userList: [] }, action = { type: '', payload: null }) {
    let newState = JSON.parse(JSON.stringify(state));
    switch (action.type) {
        case 'REGISTER':
            let i = newState.userList.findIndex((item) => {
                return item.phone == action.payload.phone;
            })
            if (i == -1) {
                newState.userList.push(action.payload);
            }
            return newState;
        default: return state;
    }
}

export default userinfo;